package com.wzk.travelspringboot.controller;

import com.wzk.travelspringboot.dto.LikedDTO;
import com.wzk.travelspringboot.dto.Result;
import com.wzk.travelspringboot.service.ScenicCommentLikeService;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author: WangZiKang
 * @Date: 2025/1/13 20:44
 */
@Slf4j
@RestController
@RequestMapping("/scenic/comment/like")
@RequiredArgsConstructor
@Validated
public class ScenicCommentLikeController {

    private final ScenicCommentLikeService service;

    @PostMapping
    public Result like(@RequestBody LikedDTO dto){
        return service.liked(dto);
    }

    @PostMapping("/cancel")
    public Result unlike(@RequestBody LikedDTO dto){
        return service.unlike(dto);
    }

}
